

import re
import requests
from curl_cffi import requests as brws
from bs4 import BeautifulSoup

URL = 'https://tieba.baidu.com/t/f'

resp = brws.get(URL,impersonate="chrome120")


soup = BeautifulSoup(resp.text, "html.parser")
items = soup.find_all("a", class_="each_topic_entrance_item")

# 提取高校名称和链接
for item in items:
    college_name = item.get_text().strip()  # 提取高校名称
    college_url = item["href"]  # 提取链接
    print(f"高校名称：{college_name}，链接：https:{college_url}")


